/**
 * @Description: test
 * @Author: Hu Outstanding
 * @Date: 2022/2/7 1:32
 */
package com.aaa.three.controller;

import com.aaa.three.aop.Log;
import com.aaa.three.pojo.query.AdminInfoQuery;
import com.aaa.three.pojo.vo.AdminVO;
import com.aaa.three.result.AjaxResult;
import com.aaa.three.service.AdminInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("adminInfo")

public class AdminInfoController {

    @Autowired
    private AdminInfoService adminInfoService;

    @RequestMapping("query")
    public AjaxResult query(AdminInfoQuery query){
        return adminInfoService.queryAdminInfo(query);
    }

    @RequestMapping("delete/{id}")
    @Log("删除员工")
    public AjaxResult delete(@PathVariable("id") Integer id){
        return adminInfoService.deleteAdmin(id);
    }

    @RequestMapping("queryDname")
    public AjaxResult queryDname(){
        return adminInfoService.queryDname();
    }
    @RequestMapping("queryOname/{did}")
    public AjaxResult queryOname (@PathVariable("did")int id){
        return adminInfoService.queryOname(id);
    }
    @RequestMapping("queryRname/{oid}")
    public AjaxResult queryRname(@PathVariable("oid") int id){
        return adminInfoService.queryRname(id);
    }
    @RequestMapping("queryEducation")
    public AjaxResult queryEducation(){
        return adminInfoService.queryEducation();
    }
    @RequestMapping("add")
    @Log("添加员工")
    public AjaxResult addAdmin(AdminVO adminVO){
        return adminInfoService.addAdmin(adminVO);
    }
    @RequestMapping("getAdminInfo/{id}")
    public AjaxResult getAdminInfo(@PathVariable("id") int id){
        return adminInfoService.getAdminInfo(id);
    }
    @RequestMapping("getOname")
    public AjaxResult getOname(){
        return adminInfoService.getOname();
    }
    @RequestMapping("getDname")
    public AjaxResult getDname(){
        return adminInfoService.getDname();
    }
    @RequestMapping("getRname")
    public AjaxResult getRname(){
        return adminInfoService.getRname();
    }
    @RequestMapping("update")
    @Log("修改员工")
    public AjaxResult updateAdmin(AdminVO adminVO){
        return adminInfoService.updateAdmin(adminVO);
    }


}
